package com.shanghaionstar.utils;

import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;

/**
 * Created by 7828wc on 16/7/13.
 */
public class ImageUtils {
    public static DisplayImageOptions getOptions(boolean cacheDisc, boolean cacheOnMemory, int resId) {
        return new DisplayImageOptions.Builder().showStubImage(resId).
                showImageForEmptyUri(resId).showImageOnFail(resId).resetViewBeforeLoading(false).
                cacheOnDisc(cacheDisc).cacheInMemory(cacheOnMemory).imageScaleType(ImageScaleType.EXACTLY_STRETCHED).
                bitmapConfig(Bitmap.Config.RGB_565).displayer(new FadeInBitmapDisplayer(200)).build();
    }
}
